<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>下载</title>
</head>

<body>
    <a href="/download/res.jog">普通下载</a>

    <!-- 
        迅雷下载协议 
        AA完整的下载地址ZZ
        然后把整个地址进行base64编码
        thunder://编码结果
    -->

    <a resrole="thunder" href="/download/res.jog">迅雷下载</a>

    <script>
        const thunders = [...document.querySelectorAll('[resrole="thunder"]')]
        thunders.forEach(a => {
            let thunderLink = `AA${a.href}ZZ`
            thunderLink = window.btoa(thunderLink) // base64编码
            thunderLink = 'thunder://' + thunderLink
            a.href = thunderLink
        })
    </script>
</body>

</html>